package com.per.mybootall.service.impl;

import com.per.mybootall.dao.LogisticsMapper;
import com.per.mybootall.dao.UserMapper;
import com.per.mybootall.pojo.Logistics;
import com.per.mybootall.pojo.User;
import com.per.mybootall.service.WebSocketAddBeanInter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class WebSocketAddBeanimpl implements WebSocketAddBeanInter {
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private LogisticsMapper logisticsMapper;
    @Override
    public List<Logistics> noReadMessage(String name){

        System.out.println("进入的名字:"+name);
        User useri= userMapper.selectByUsernameforUser(name);

        System.out.println("user:"+useri.toString());
        System.out.println("id:"+useri.getId());
        List<Logistics> list= logisticsMapper.selectIdByName(useri.getId());
        System.out.println("您有"+list.size()+"条消息未读");

        return list;
    }

//    public List<Logistics> noreallyEmail(String name){
//
//    }
}
